<!--
	作者：2575202388@qq.com
	时间：2018-10-14
	描述：首页组件
-->

<template>
	<div style="background: #e9e9e9;height: auto;overflow: hidden;">
		<div style="padding-left: 15px; width: 100%; float: left;height:30px;overflow:hidden;line-height:30px;">{{user.SYSTEMNAME}}
			<span style="padding-left:10px;padding-right: 10px;">></span>
			<span style="color:#187fff;">首页</span>
		</div>

		<div class="homeDiv" style="width: 48%;">
			<homemyinfo :whk="whk"></homemyinfo>
		</div>

	    <div class="homeDiv" style="width: 48%;">
			<homepie :stfdb="stfdb"></homepie>
		</div>

	    <div style="width: 98%; float: left; background:#eee;height:380px;margin-top:20px;margin-bottom:30px;margin-left:1%;margin-right:1%;">
	        <Card :bordered="false" style="height:380px;">
	            <p slot="title">
	             	<Icon type="ios-volume-up" style="color:#5bace8;font-size: 28px;"/>
	            	<span style="padding-left:2px;color:#333333;font-size: 14px;font-weight: normal;">最新报名情况</span>
	            	<Icon type="ios-more" style="color:#333333;font-size: 25px;float:right;"/>
	            </p>
	            <div>
	            	<Table stripe size="small" :loading="loading" :columns="columns" :data="newstatic">
						<Spin fix slot="loading">
							<Icon type="md-aperture" size=30 class="rotate"></Icon>
							<div style="width: 100px;color: #515a6e;">{{loadmsg}}</div>
						</Spin>
					</Table>
	            </div>
	        </Card>
	    </div>  
	</div>
</template>

<script>
	import homepie from "./homepie";
	import homemyinfo from "./homemyinfo";
	export default {
		name:"home",
		data() {
			return {
				whk:[],
				stfdb:[],
				newstatic:[],
				loading:false,
				loadmsg:'加载中......',
				columns: [
                    {
                        type: 'index',
                        width: 60,
                        title: '序号',
                        align: 'center'
                    },{
                        title: '辅导班名称',
                        key: 'MC',
                        align: 'center',
                    },{
                        title: '学生姓名',
                        key: 'SNAME',
                        align: 'center'
                    },{
                        title: '身份证号',
                        key: 'SFZH',
                        align: 'center'
                    },{
                        title: '年级',
                        key: 'NJ',
                        align: 'center'
                    },{
                        title: '班级',
                        key: 'BJ',
                        align: 'center'
                    },
                    {
                        title: '审核情况',
                        key: 'SHQKT',
                        width: 100,
                        align: 'center'
                    },
                ],
			}
		},
		components: {
			homepie,
			homemyinfo
		},
		computed: {
			user: function() {
				return this.$store.state.app.user;
			}
		},
		
		methods: {
			getHomeData(){
				this.$http.get("/host/stgl/getHomeData.html")
				.then(datas => {
					this.whk=datas.whk;
					this.stfdb=datas.stfdb;
					this.newstatic=datas.newstatic;
				});
			}
		},
		mounted(){	
			this.getHomeData();
		}
	}
</script>


<style scoped="scoped">
	.homeDiv{
		float: left; 
		background:#eee;
		margin-top:5px;
		margin-bottom:5px;
		margin-left:1%;
		margin-right:1%;
		height:430px;	
	}
</style>



